package XMLScene;

import java.io.FileNotFoundException;

import Tracer.*;

/**
 * Modal class of surface object
 * 
 * @author Hongyi Zhao
 * 
 */
public class RTSurface {
	/**
	 * a default diffuse coefficient
	 */
	private float sDiffuse = 1.0f;
	/**
	 * a default reflect coefficient
	 */
	private float sReflect = 0.0f;
	/**
	 * a pigment for object surface
	 */
	private RTPigment sPigment = null;

	public RTSurface(RTColor color) {
		sPigment = new RTPigment(color);
	}

	public RTSurface(String imagePath) throws FileNotFoundException {
		sPigment = new RTPigment(imagePath);
	}

	/**
	 * Setter of diffuse
	 * 
	 * @param d
	 *            a diffuse coefficient
	 */
	public void setDiffuse(float d) {
		sDiffuse = d;
	}

	/**
	 * Setter of reflect
	 * 
	 * @param r
	 *            a reflect coefficient
	 */
	public void setReflect(float r) {
		sReflect = r;
	}

	/**
	 * Getter of diffuse
	 * 
	 * @return diffuse coefficient
	 */
	public float getDiffuse() {
		return sDiffuse;
	}

	/**
	 * Getter of reflect
	 * 
	 * @return reflect coefficient
	 */
	public float getReflect() {
		return sReflect;
	}

	/**
	 * Getter of reflect
	 * 
	 * @return the pigment
	 */
	public RTPigment getPigment() {
		return sPigment;
	}
}
